<template>
  <div>
    <div class="header">
      <button @click="update()">刷新页面</button>
    </div>
  </div>
</template>

<script>
export default {
  name:'RefreshA',
  // 根节点注入方法
  inject:[
    'reload'
  ],
  created(){
    console.log('created')
  },
  mounted(){
    console.log('mounted')
  },
  methods:{
    update(){
      this.reload()
      console.log('刷新页面')
    }
  }
}
</script>